<template>
  <div class="body">
    <div class="personnel">
      <div class="nva">
        <div class="Youth">{{societyName}}報名列表</div>
      </div>
    </div>
    <div v-for="(li,index) in list" :key="index" class="person_list">
      <div style="width: 100%">
        <div class="headIcon" :style="{background: 'url('+ li.photo + ')'}"></div>
        <div class="name">{{li.name}}</div>
      </div>
    </div>
  </div>
</template>

<script>
import { isLogin } from '@/api/login'
import { getJoinListByAid } from '@/api/society'
export default {
  name: 'JoinList',
  data () {
    return {
      list: [],
      societyName: ''
    }
  },
  created () {
    this.isLogin()
    this.loadList()
  },
  methods: {
    loadList () {
      getJoinListByAid({
        aid: this.$route.query.aid
      }).then(res => {
        if (res.code === 0) {
          this.$router.go(-1)
        } else {
          this.list = res.data.joinList
          this.societyName = res.data.societyName
        }
      }).catch(err => {
        console.log(err)
      })
    },
    isLogin () {
      isLogin().then(res => {
        if (res.code === 0) {
          alert('请先登录')
          this.$router.push('/login')
        }
      })
    }
  }
}
</script>

<style type="text/css" scoped>
* {
  margin: 0;
  padding: 0;
  touch-action: pan-y;
}

.body {
  background: rgb(255, 255, 255);
  font-family: PingFang SC;
  width: 100%;
  min-height: 800px;
  height: auto;
}

.mui-content > .mui-table-view:first-child {
  margin-top: -1px;
}

.mui-pull-caption {
  display: none !important;
}

.person {
  float: left;
  width: 92%;
  margin-left: 4%;
  background: white;
}

.person_list {
  border-bottom: solid 1px #eceef0;
  width: 100%;
  height: 69px;
}

.headIcon {
  width: 48px;
  height: 48px;
  border-radius: 24px;
  float: left;
  margin-top: 10px;
  margin-left: 16px;
  background-size: cover !important;
}

.name {
  width: 80%;
  height: 100%;
  float: left;
  line-height: 70px;
  margin-left: 8px;
  font-size: 18px;
  font-weight: 600;
  color: rgba(22, 22, 22, 1);
  text-align: center;
}

.discovery {
  float: right;
  display: flex;
  justify-content: right;
  align-items: center;
  margin-top: 20px;
  margin-right: 25px;
}

.discovery div {
  background: url(../style/img/sign.png) no-repeat;
  background-size: cover;
  width: 10px;
  height: 20px;
  float: right;
  display: inline-block;
}

.nva {
  float: left;
  width: 100%;
  height: 68px;
  background: white;
}

.Youth {
  float: left;
  font-size: 16px;
  line-height: 69px;
  padding-left: 10px;
  height: 68px;
  width: 100%;
  overflow: hidden;
  color: grey;
  text-align: center;
}

.sum {
  float: right;
  font-size: 13px;
  font-weight: 600;
  line-height: 69px;
  padding-right: 10px;
  color: #777777;
}

.list {
  width: 90px;
  height: 32px;
  float: right;
  background: #f97782;
  border-radius: 15px;
  color: white;
  text-align: center;
  line-height: 32px;
  margin: 17px 10px;
}

.personnel {
  float: left;
  width: 94%;
  margin-left: 3%;
}

.mui-scroll-wrapper {
  top: 68px;
}

.mui-content {
  background: white;
}

[v-cloak] {
  display: none;
}

.noData {
  text-align: center;
  line-height: 44px;
  color: grey;
}
</style>
